package com.ss.baseinfo.dao.impl;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.stereotype.Repository;

import com.ss.baseinfo.dao.CourseDao;
import com.ss.baseinfo.pojo.CourseInfo;
/**
 * 专业管理
 * @author Administrator
 *
 */
@Repository("courseDao")
public class CourseDaoImpl extends SqlMapClientDaoSupport implements CourseDao {

	@Override
	public void add(CourseInfo info) throws Exception {
		// TODO Auto-generated method stub
		this.getSqlMapClientTemplate().insert("course.add",info);
	}

	@Override
	public int update(CourseInfo info) throws Exception {
		// TODO Auto-generated method stub
		return this.getSqlMapClientTemplate().update("course.update",info);
	}

	@Override
	public List<CourseInfo> query(CourseInfo info) throws Exception {
		// TODO Auto-generated method stub
		return this.getSqlMapClientTemplate().queryForList("course.query",info);
	}

	@Override
	public CourseInfo getOneById(String id) throws Exception {
		// TODO Auto-generated method stub
		return (CourseInfo)this.getSqlMapClientTemplate().queryForObject("course.getOneById",id);
	}

}
